package org.example.reactor;

import java.util.HashSet;
import java.util.Iterator;
import java.util.Set;

public class IteratorTest {
    public static void main(String[] args) {
        Set<String> strs = new HashSet<>();
        strs.add("java");

        Iterator<String> iterator = strs.iterator();
        while (iterator.hasNext()) {
            System.out.println(iterator.next());
            iterator.remove();
        }

        System.out.println(strs.isEmpty());

    }
}
